<!DOCTYPE html>
<html>
    
    <head>
        <meta charset="utf-8">
        <title>
            用户管理-修改密码
        </title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <link rel="stylesheet" href="../css/x-admin.css" media="all">
    </head>
    <body>
        <div class="x-body">
            <form onsubmit="return checkPassword()" class="layui-form" action="reset_password.do" method="post">
                <div class="layui-form-item">
                    <label for="L_username" class="layui-form-label">
                        昵称
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="L_username" name="username" disabled="" value="宋加加" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_repass" class="layui-form-label">
                        <span class="x-red">*</span>旧密码
                    </label>
                    <div class="layui-input-inline">
                        <input type="password" id="L_repass" name="oldpass" id="oldpass" required lay-verify="required"
                        autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_pass" class="layui-form-label">
                        <span class="x-red">*</span>新密码
                    </label>
                    <div class="layui-input-inline">
                        <input type="password" id="L_pass" name="newpass" id="newpass" required lay-verify="required"
                        autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        6到16个字符
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_repass" class="layui-form-label">
                        <span class="x-red">*</span>确认密码
                    </label>
                    <div class="layui-input-inline">
                        <input type="password" id="L_repass" name="repass" id="repass" required lay-verify="required"
                        autocomplete="off" class="layui-input" onblur="checkPassword()">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_repass" class="layui-form-label">
                    </label>
                    <input type="submit" name="" class="layui-btn" lay-filter="save" lay-submit="" value="确定修改">
                    
                </div>
            </form>
        </div>
        <script type="text/javascript">
           function checkPassword(){
               var pass = document.getElementById("newpass");
               var repass = document.getElementById("repass");

               if (pass == repass) {//pass.trim() == repass.trim()  trim()去重忽然报错  因为js没有这个内置方法
                 return true;           
               }
               else{

                  alert("两次密码输入不一致");
                  return false;
                  
               }
                
            }
        </script>
        
    </body>

</html>